package org.haifi.game.service.impl;

import java.util.Map;

import org.haifi.game.model.MapInstance;
import org.haifi.game.model.Player;
import org.haifi.game.service.MapInstanceManager;

import com.google.common.collect.Maps;

public class MapInstanceManagerImpl implements MapInstanceManager {
	/**
	 * 世界地图,只存在一份
	 */
	private Map<Integer, MapInstance> worldMaps = Maps.newConcurrentMap();

	/**
	 * 获得出生点地图
	 * 
	 * @return
	 */
	public MapInstance getBornMap() {
		MapInstance mapInstance = new MapInstance();
		return mapInstance;
	}

	/**
	 * 玩家进入地图
	 * 
	 * @param mapInstance
	 * @param player
	 */
	public void enterMap(MapInstance mapInstance, Player player) {
		mapInstance.getPlayers().put(player.getId(), player);
		// 发送广播,通知地图上有新玩家加入
	}
}
